import java.util.Arrays;

/**
 * @Author 12629
 * @Description：
 */
class Main {
    public static void main(String[] args) {
        System.out.println("Main......");
    }
}
public class Test2 {

    public static void main(String[] args) {
        int[][] array = new int[2][];
        array[0] = new int[]{1,2,3,4,5};
        array[1] = new int[]{6,7};

        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[i].length; j++) {
                System.out.print(array[i][j]+" ");
            }
            System.out.println();
        }
        System.out.println("========");

        //System.out.println(Arrays.toString(array));
        System.out.println(Arrays.deepToString(array));
    }

    public static void main5(String[] args) {
        int[][] array = {{1,2,3},{4,5,6}};
        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[i].length; j++) {
                System.out.print(array[i][j]+" ");
            }
            System.out.println();
        }
    }

    public static void main4(String[] args) {
        int[][] array = {{1,2,3},{4,5,6}};
        System.out.println(array.length);//2
        System.out.println(array[0]);
        System.out.println(array[1]);
        System.out.println("==========");
        System.out.println(Arrays.toString(array[0]));
        System.out.println(Arrays.toString(array[1]));
        System.out.println("==========");
        System.out.println(array[0].length);//3
        System.out.println(array[1].length);
    }

    public static void main3(String[] args) {
        int[][] array = {{1,2,3},{4,5,6}};
        /*array[0][1] = 25;
        System.out.println(array[0][1]);*/
        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < 3; j++) {
                System.out.print(array[i][j]+" ");
            }
            System.out.println();
        }
    }


    public static void main2(String[] args) {
        int[][] array1 = {{1,2,3},{4,5,6}};
        int[][] array2 = new int[][]{{1,2,3},{4,5,6}};
        int[][] array3 = new int[2][3];
        //可以省略列 但是不能省略行  可以实现为 不规则二维数组
        int[][] array4 = new int[2][];


    }


    public static void main1(String[] args) {
        int[] array = {1,2,3,4,5,6,7,8,9};

        //int[] copy = Arrays.copyOf(array,array.length*2);
        //array = Arrays.copyOf(array,array.length*2);

        int[] copy = new int[array.length*2];

        System.arraycopy(array,2,copy,3,array.length-2);

        System.out.println(Arrays.toString(copy));

    }
}
